import axios from "axios"
import typesUrls from "../../urls/product/types"

export default {
  // 获取所有类型
  fetchGetTypesByPage (params) {
    return axios.post(typesUrls.getTypesByPage, params)
  },
  // 添加类型
  fetchAddTypes (data) {
    console.log(data)
    return axios.post(typesUrls.addTypes, data)
  },
  // 修改类型
  fetchEditTypes (data) {
    return axios.post(typesUrls.editTypes, data)
  },
  // 批量禁用/解禁
  fetchBatchChangeState (data) {
    return axios.post(typesUrls.batchChangeState, data)
  },
  // 校验类型是否唯一
  fetchCheckTypes (data) {
    return axios.post(typesUrls.checkTypes + "?" + data)
  },
  // 获取所有类型
  fetchGetAllTypes () {
    return axios.post(typesUrls.getAllTypes)
  }
}
